package com.yjhb.android.sbz.mvp.myinviter;

import com.yjhb.android.sbz.http.HttpObserver;
import com.yjhb.android.sbz.http.HttpTool;
import com.yjhb.android.sbz.mvp.ConventionPresenter;
import com.jojo.android.zxlib.base.mvp.CommonView;

/**
 * 创建者 zx
 * 创建时间 2021/1/12 10:03
 */
public class MyInviterPresenter extends ConventionPresenter<CommonView<Object>> {
    private final String TAG = "MyInviterPresenter";

    @Override
    protected void onDestroy() {

    }

    public MyInviterPresenter(CommonView<Object> objectCommonView) {
        super(objectCommonView);
    }

    public void bindMyInviter(int inviterId) {
        if (view != null) {
            view.onWait();
        }
        HttpTool.request(model.bindMyInvite(inviterId), new HttpObserver<Object>() {
            @Override
            public void onResult(Object data) {
                if (view != null) {
                    view.onSuccess(data);
                }
            }

            @Override
            public void onError(int code, String msg) {
                if (view != null) {
                    view.onFailure(code, msg);
                }
            }
        });
    }
}
